
//通过某个对象绑定的对象，那么this指向那个对象
//案例1
function foo1() {
    console.log(1)
    console.log(this)
}
var obj1 = {
    name: 'kkzx',
    fooo1: foo1
}
obj1.fooo1() //这里指向的是obj1对象

//案例2
var obj2 = {
    name: 'kkzzzzz',
    eating: function () {
        console.log(this.name + ' : eating...')
    },
    running: function () {
        console.log(obj1.name + ' : running...')
    }
}
obj2.eating() //这是this指向的是obj2
obj2.running() //这里的是obj1

var fn2 = obj2.eating
fn2() // 这里独立调用的this指向window
















